from Base import message, intersect, SS_VALID
from DRG import MDCR_DRG

def group(record):
  adrg_zd = ["Z51.800x095","Z51.800x951","Z51.800x952","Z51.800x981","Z51.801","Z51.805","Z51.807","Z51.810"]
  adrg_zd1 = []
  adrg_ss = ["99.2800x003","99.2800x004","99.2800x005","99.2800x006","99.2801"]
  adrg_ss1 = []
  dept_list = []

  if True and record.zdList[0] in adrg_zd and record.ssList and record.ssList[0] in adrg_ss:
    message('符合RN2入组条件，匹配规则：主诊断匹配、主手术匹配')

    if MDCR_DRG.RN21_group(record):
      return 'RN21'

    if MDCR_DRG.RN25_group(record):
      return 'RN25'
        
    return 'RN2'
  else:
    return ''
    
